/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class IndexDeferredItems
/*    */   extends RedoableOp
/*    */ {
/* 30 */   private int[] mItemIds = null;
/* 31 */   private byte[] mItemTypes = null;
/*    */   
/*    */   public IndexDeferredItems() {
/* 34 */     super(MailboxOperation.IndexDeferredItems);
/*    */   }
/*    */   
/*    */   public void setIds(int[] itemIds, byte[] itemTypes) {
/* 38 */     this.mItemIds = itemIds;
/* 39 */     this.mItemTypes = itemTypes;
/* 40 */     if (this.mItemIds.length != this.mItemTypes.length) {
/* 41 */       throw new IllegalArgumentException("ItemIds and ItemTypes arrays must be same size");
/*    */     }
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 46 */     out.writeInt(this.mItemIds.length);
/* 47 */     for (int i = 0; i < this.mItemIds.length; i++)
/* 48 */       out.writeInt(this.mItemIds[i]);
/* 49 */     for (int i = 0; i < this.mItemIds.length; i++) {
/* 50 */       out.writeByte(this.mItemTypes[i]);
/*    */     }
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 55 */     int count = in.readInt();
/* 56 */     this.mItemIds = new int[count];
/* 57 */     this.mItemTypes = new byte[count];
/* 58 */     for (int i = 0; i < count; i++)
/* 59 */       this.mItemIds[i] = in.readInt();
/* 60 */     for (int i = 0; i < count; i++)
/* 61 */       this.mItemTypes[i] = in.readByte();
/*    */   }
/*    */   
/*    */   public boolean deferCrashRecovery() {
/* 65 */     return true;
/*    */   }
/*    */   
/* 68 */   public int[] getItemIds() { return this.mItemIds; }
/* 69 */   public byte[] getItemTypes() { return this.mItemTypes; }
/*    */   
/*    */   protected String getPrintableData()
/*    */   {
/* 73 */     StringBuilder sb = new StringBuilder();
/* 74 */     int[] arr$ = this.mItemIds;int len$ = arr$.length; for (int i$ = 0; i$ < len$; i$++) { Integer i = Integer.valueOf(arr$[i$]);
/* 75 */       sb.append(i).append(',');
/*    */     }
/* 77 */     return sb.toString();
/*    */   }
/*    */   
/*    */   public void redo()
/*    */     throws Exception
/*    */   {}
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/IndexDeferredItems.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */